package org.csu.chatserver.mapper;


import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.csu.chatserver.entity.pojo.User;

@Mapper
public interface UserMapper extends BaseMapper<User> {
    
    @Select("select password from user where username = #{username}")
    String getPasswordByName(String username);

    @Select("select id from user where username = #{username}")
    String getIdByName(String username);

    @Select("select * from user where username = #{username}")
    User getUserByName(String username);

    @Select("SELECT username FROM user WHERE id = #{id}")
    String getUsernameById(String id);
}
